# coding:utf-8

from sqlalchemy import Column, Integer, String, DateTime, ForeignKey
from sqlalchemy.ext.declarative import declarative_base

Base = declarative_base()


# def init_db():
# Base.metadata.create_all()


class Sharer(Base):
	__tablename__ = "sharer"
	sharer_id = Column(Integer, primary_key=True)
	nickname = Column(String(50))
	real_name = Column(String(50))
	gender = Column(String(2))
	portrait = Column(String(50))


class Comment(Base):
	__tablename__ = "note_comment"
	note_comment_id = Column(Integer, primary_key=True)
	sharer_id = Column(Integer)
	comment_content = Column(String(500))
	comment_time = Column(DateTime)
	note_id = Column(Integer)


class LoginInfo(Base):
	__tablename__ = "login_info"
	sharer_id = Column(Integer, ForeignKey("sharer.sharer_id"), primary_key=True)
	sharer_email = Column(String(100))
	login_password = Column(String(200))
	register_time = Column(DateTime)
	login_status = Column(String(2))
